package com.threeox.commonlibrary.ui.activity;

import android.content.Context;
import android.os.Bundle;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import com.threeox.commonlibrary.entity.engine.model.listmodel.ListModelMsg;
import com.threeox.commonlibrary.ui.activity.base.BaseModelActivity;
import com.threeox.commonlibrary.ui.view.engineview.listmodel.ListModelBaseView;
import com.threeox.commonlibrary.util.ActivityUtils;

/**
 *
 * @ClassName: ListModelActivity
 *
 * @Description: Todo(列表页面模型的Activity)
 *
 * @author 赵屈犇
 *A
 * @date 创建时间:2017/4/28 下午3:34
 *
 * @version 1.0
 */
public class ListModelActivity extends BaseModelActivity {

    protected ListModelMsg mListModelMessage;
    protected ListModelBaseView mListModelBaseView;

    @Override
    protected void setView(Bundle stateBundle) {
        mListModelBaseView = new ListModelBaseView(mContext);
        initFullScreenState(mListModelBaseView);
        mListModelBaseView.initData(mIntent);
        mListModelMessage = mListModelBaseView.getListModelMessage();
        addContentView(mListModelBaseView, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
    }

    @Override
    protected void initView() {
        initBaseModelMessage(mListModelMessage, mListModelBaseView);
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void setListener() {

    }

    /**
     * 直接启动不传递参数
     *
     * @param context
     * @param model
     */
    public static void start(Context context, int model) {
        ActivityUtils.init(context, ListModelActivity.class)
                .putIntent(ListModelBaseView.FILENAMEMODE, model)
                .start();
    }

}
